<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script>
        var mouth = parseInt(prompt("请输入月份："))
        switch (mouth) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10: 
            case 12: 
                alert("当月天数为31天")  
                break;
            case 2:
                var year = parseInt(prompt("请输入年份"));
                if( year % 100===0){
                    alert("当月天数为"+ (year % 400===0?"29":"28")+"天")
                }else{
                    alert("当月天数为"+ (year % 4 ===0 ?"29":"28")+"天")
                }
                break;
            default:
                alert("当月天数为30天") 
                break;
        }
    </script>
</head>
<body>
    
</body>
</html>